import request from '@/utils/request.js'
// 获取组织架构数据
export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}
// 删除部门
export const delDepartments = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 新增部门
export const addDepartments = (data) => {
  return request({
    url: `/company/department/`,
    method: 'post',
    data
  })
}
// 修改部门
export const editDepartments = (data) => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 获取单个部门详情
export const getDepartmentsDetail = (id) => {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}
